﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using VirtualOrg.Helper;

namespace VirtualOrg.Web
{
    public partial class VOrgMaster : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            LoadUserProfile();
        }

        private void LoadUserProfile()
        {
            try
            {
                if (Request.Cookies.AllKeys.Contains(SiteConstants.CookieName))
                {
                    SessionInfo sessionInfo = SiteHelper.DecryptSession(Request.Cookies[SiteConstants.CookieName].Value);
                    lblUserInfo.Text = "Hello, " + sessionInfo.FullName;
                    pnlUserInfo.Visible = true;
                    imgProfilePic.ImageUrl = string.Format("~/Content/Photos/ProfilePic/{0}", sessionInfo.ImagePath);
                    acreateaccount.Visible = false;
                }
            }
            catch
            {
            }
        }
    }
}